using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace DTO
{
	/// <summary> 
	///Author: nnamthach@gmail.com 
	/// <summary>
	
    public class BAOCAOTHUEInfo
    {
		#region Local Variable
		public enum Field
		{
			ID,
			NGAYPS,
			KYHIEUHD,
			SOHD,
			TENKH,
			MSTHUE,
			HANGHOA,
			DOANHSO,
			THUESUAT,
			THUEGTGT,
			GHICHU,
			BANRA,
			DIACHI,
			SOBT,
			EXP2HTKK,
			NGAYGD,
			CUSINFO,
            LOAIBT,
			CREATEBY,
			MODIFIEDBY,
			CREATEDATE,
			MODIFIEDDATE
		}
		private Int64 _ID;
		private DateTime _NGAYPS;
		private String _KYHIEUHD;
		private String _SOHD;
		private String _TENKH;
		private String _MSTHUE;
		private String _HANGHOA;
		private Double _DOANHSO;
		private Int16 _THUESUAT;
		private Double _THUEGTGT;
		private String _GHICHU;
		private Boolean _BANRA;
		private String _DIACHI;
		private String _SOBT;
		private Boolean _EXP2HTKK;
		private DateTime _NGAYGD;
		private String _CUSINFO;
        private string _LOAIBT;
		private String _CREATEBY;
		private String _MODIFIEDBY;
		private DateTime _CREATEDATE;
		private DateTime _MODIFIEDDATE;
		
		public Int64 ID{	get{ return _ID;} set{_ID = value;} }
		public DateTime NGAYPS{	get{ return _NGAYPS;} set{_NGAYPS = value;} }
		public String KYHIEUHD{	get{ return _KYHIEUHD;} set{_KYHIEUHD = value;} }
		public String SOHD{	get{ return _SOHD;} set{_SOHD = value;} }
		public String TENKH{	get{ return _TENKH;} set{_TENKH = value;} }
		public String MSTHUE{	get{ return _MSTHUE;} set{_MSTHUE = value;} }
		public String HANGHOA{	get{ return _HANGHOA;} set{_HANGHOA = value;} }
		public Double DOANHSO{	get{ return _DOANHSO;} set{_DOANHSO = value;} }
		public Int16 THUESUAT{	get{ return _THUESUAT;} set{_THUESUAT = value;} }
		public Double THUEGTGT{	get{ return _THUEGTGT;} set{_THUEGTGT = value;} }
		public String GHICHU{	get{ return _GHICHU;} set{_GHICHU = value;} }
		public Boolean BANRA{	get{ return _BANRA;} set{_BANRA = value;} }
		public String DIACHI{	get{ return _DIACHI;} set{_DIACHI = value;} }
		public String SOBT{	get{ return _SOBT;} set{_SOBT = value;} }
		public Boolean EXP2HTKK{	get{ return _EXP2HTKK;} set{_EXP2HTKK = value;} }
		public DateTime NGAYGD{	get{ return _NGAYGD;} set{_NGAYGD = value;} }
		public String CUSINFO{	get{ return _CUSINFO;} set{_CUSINFO = value;} }
        public String LOAIBT { get { return _LOAIBT; } set { _LOAIBT = value; } }
		public String CREATEBY{	get{ return _CREATEBY;} set{_CREATEBY = value;} }
		public String MODIFIEDBY{	get{ return _MODIFIEDBY;} set{_MODIFIEDBY = value;} }
		public DateTime CREATEDATE{	get{ return _CREATEDATE;} set{_CREATEDATE = value;} }
		public DateTime MODIFIEDDATE{	get{ return _MODIFIEDDATE;} set{_MODIFIEDDATE = value;} }
		
        #endregion LocalVariable
        
        #region Constructor
		public BAOCAOTHUEInfo()
		{
			_ID = 0;
			_NGAYPS = DateTime.Now;
			_KYHIEUHD = "";
			_SOHD = "";
			_TENKH = "";
			_MSTHUE = "";
			_HANGHOA = "";
			_DOANHSO = 0;
			_THUESUAT = (Int16)0;
			_THUEGTGT = 0;
			_GHICHU = "";
			_BANRA = true;
			_DIACHI = "";
			_SOBT = "";
			_EXP2HTKK = true;
			_NGAYGD = DateTime.Now;
			_CUSINFO = "";
            _LOAIBT = "";
			_CREATEBY = "";
			_MODIFIEDBY = "";
			_CREATEDATE = DateTime.Now;
			_MODIFIEDDATE = DateTime.Now;
		}
		public BAOCAOTHUEInfo(
		Int64 ID,
		DateTime NGAYPS,
		String KYHIEUHD,
		String SOHD,
		String TENKH,
		String MSTHUE,
		String HANGHOA,
		Double DOANHSO,
		Int16 THUESUAT,
		Double THUEGTGT,
		String GHICHU,
		Boolean BANRA,
		String DIACHI,
		String SOBT,
		Boolean EXP2HTKK,
		DateTime NGAYGD,
		String CUSINFO,
            String LOAIBT,
		String CREATEBY,
		String MODIFIEDBY,
		DateTime CREATEDATE,
		DateTime MODIFIEDDATE
		)
		{
			_ID = ID;
			_NGAYPS = NGAYPS;
			_KYHIEUHD = KYHIEUHD;
			_SOHD = SOHD;
			_TENKH = TENKH;
			_MSTHUE = MSTHUE;
			_HANGHOA = HANGHOA;
			_DOANHSO = DOANHSO;
			_THUESUAT = THUESUAT;
			_THUEGTGT = THUEGTGT;
			_GHICHU = GHICHU;
			_BANRA = BANRA;
			_DIACHI = DIACHI;
			_SOBT = SOBT;
			_EXP2HTKK = EXP2HTKK;
			_NGAYGD = NGAYGD;
			_CUSINFO = CUSINFO;
            _LOAIBT = LOAIBT;
			_CREATEBY = CREATEBY;
			_MODIFIEDBY = MODIFIEDBY;
			_CREATEDATE = CREATEDATE;
			_MODIFIEDDATE = MODIFIEDDATE;
		}
		public BAOCAOTHUEInfo(DataRow dr)
		{
			if (dr != null)
			{
				_ID = dr[Field.ID.ToString()] == DBNull.Value?0:Convert.ToInt64(dr[Field.ID.ToString()]);
				_NGAYPS = dr[Field.NGAYPS.ToString()] == DBNull.Value?DateTime.Now:Convert.ToDateTime(dr[Field.NGAYPS.ToString()]);
				_KYHIEUHD = dr[Field.KYHIEUHD.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.KYHIEUHD.ToString()]);
				_SOHD = dr[Field.SOHD.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.SOHD.ToString()]);
				_TENKH = dr[Field.TENKH.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.TENKH.ToString()]);
				_MSTHUE = dr[Field.MSTHUE.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.MSTHUE.ToString()]);
				_HANGHOA = dr[Field.HANGHOA.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.HANGHOA.ToString()]);
				_DOANHSO = dr[Field.DOANHSO.ToString()] == DBNull.Value?0:Convert.ToDouble(dr[Field.DOANHSO.ToString()]);
				_THUESUAT = dr[Field.THUESUAT.ToString()] == DBNull.Value?(Int16)0:Convert.ToInt16(dr[Field.THUESUAT.ToString()]);
				_THUEGTGT = dr[Field.THUEGTGT.ToString()] == DBNull.Value?0:Convert.ToDouble(dr[Field.THUEGTGT.ToString()]);
				_GHICHU = dr[Field.GHICHU.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.GHICHU.ToString()]);
				_BANRA = dr[Field.BANRA.ToString()] == DBNull.Value?true:Convert.ToBoolean(dr[Field.BANRA.ToString()]);
				_DIACHI = dr[Field.DIACHI.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.DIACHI.ToString()]);
				_SOBT = dr[Field.SOBT.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.SOBT.ToString()]);
				_EXP2HTKK = dr[Field.EXP2HTKK.ToString()] == DBNull.Value?true:Convert.ToBoolean(dr[Field.EXP2HTKK.ToString()]);
				_NGAYGD = dr[Field.NGAYGD.ToString()] == DBNull.Value?DateTime.Now:Convert.ToDateTime(dr[Field.NGAYGD.ToString()]);
				_CUSINFO = dr[Field.CUSINFO.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CUSINFO.ToString()]);
                _LOAIBT = dr[Field.LOAIBT.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.LOAIBT.ToString()]);
				_CREATEBY = dr[Field.CREATEBY.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CREATEBY.ToString()]);
				_MODIFIEDBY = dr[Field.MODIFIEDBY.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.MODIFIEDBY.ToString()]);
				_CREATEDATE = dr[Field.CREATEDATE.ToString()] == DBNull.Value?DateTime.Now:Convert.ToDateTime(dr[Field.CREATEDATE.ToString()]);
				_MODIFIEDDATE = dr[Field.MODIFIEDDATE.ToString()] == DBNull.Value?DateTime.Now:Convert.ToDateTime(dr[Field.MODIFIEDDATE.ToString()]);
			}
		}
		public BAOCAOTHUEInfo(DataRowView dr)
		{
			if (dr != null)
			{
				_ID = dr[Field.ID.ToString()] == DBNull.Value?0:Convert.ToInt64(dr[Field.ID.ToString()]);
				_NGAYPS = dr[Field.NGAYPS.ToString()] == DBNull.Value?DateTime.Now:Convert.ToDateTime(dr[Field.NGAYPS.ToString()]);
				_KYHIEUHD = dr[Field.KYHIEUHD.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.KYHIEUHD.ToString()]);
				_SOHD = dr[Field.SOHD.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.SOHD.ToString()]);
				_TENKH = dr[Field.TENKH.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.TENKH.ToString()]);
				_MSTHUE = dr[Field.MSTHUE.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.MSTHUE.ToString()]);
				_HANGHOA = dr[Field.HANGHOA.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.HANGHOA.ToString()]);
				_DOANHSO = dr[Field.DOANHSO.ToString()] == DBNull.Value?0:Convert.ToDouble(dr[Field.DOANHSO.ToString()]);
				_THUESUAT = dr[Field.THUESUAT.ToString()] == DBNull.Value?(Int16)0:Convert.ToInt16(dr[Field.THUESUAT.ToString()]);
				_THUEGTGT = dr[Field.THUEGTGT.ToString()] == DBNull.Value?0:Convert.ToDouble(dr[Field.THUEGTGT.ToString()]);
				_GHICHU = dr[Field.GHICHU.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.GHICHU.ToString()]);
				_BANRA = dr[Field.BANRA.ToString()] == DBNull.Value?true:Convert.ToBoolean(dr[Field.BANRA.ToString()]);
				_DIACHI = dr[Field.DIACHI.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.DIACHI.ToString()]);
				_SOBT = dr[Field.SOBT.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.SOBT.ToString()]);
				_EXP2HTKK = dr[Field.EXP2HTKK.ToString()] == DBNull.Value?true:Convert.ToBoolean(dr[Field.EXP2HTKK.ToString()]);
				_NGAYGD = dr[Field.NGAYGD.ToString()] == DBNull.Value?DateTime.Now:Convert.ToDateTime(dr[Field.NGAYGD.ToString()]);
				_CUSINFO = dr[Field.CUSINFO.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CUSINFO.ToString()]);
                _LOAIBT = dr[Field.LOAIBT.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.LOAIBT.ToString()]);
				_CREATEBY = dr[Field.CREATEBY.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CREATEBY.ToString()]);
				_MODIFIEDBY = dr[Field.MODIFIEDBY.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.MODIFIEDBY.ToString()]);
				_CREATEDATE = dr[Field.CREATEDATE.ToString()] == DBNull.Value?DateTime.Now:Convert.ToDateTime(dr[Field.CREATEDATE.ToString()]);
				_MODIFIEDDATE = dr[Field.MODIFIEDDATE.ToString()] == DBNull.Value?DateTime.Now:Convert.ToDateTime(dr[Field.MODIFIEDDATE.ToString()]);
			}
		}
		public BAOCAOTHUEInfo(BAOCAOTHUEInfo objEntr)
		{			
			_ID = objEntr.ID;			
			_NGAYPS = objEntr.NGAYPS;			
			_KYHIEUHD = objEntr.KYHIEUHD;			
			_SOHD = objEntr.SOHD;			
			_TENKH = objEntr.TENKH;			
			_MSTHUE = objEntr.MSTHUE;			
			_HANGHOA = objEntr.HANGHOA;			
			_DOANHSO = objEntr.DOANHSO;			
			_THUESUAT = objEntr.THUESUAT;			
			_THUEGTGT = objEntr.THUEGTGT;			
			_GHICHU = objEntr.GHICHU;			
			_BANRA = objEntr.BANRA;			
			_DIACHI = objEntr.DIACHI;			
			_SOBT = objEntr.SOBT;			
			_EXP2HTKK = objEntr.EXP2HTKK;			
			_NGAYGD = objEntr.NGAYGD;			
			_CUSINFO = objEntr.CUSINFO;
            _LOAIBT = objEntr.LOAIBT;
			_CREATEBY = objEntr.CREATEBY;			
			_MODIFIEDBY = objEntr.MODIFIEDBY;			
			_CREATEDATE = objEntr.CREATEDATE;			
			_MODIFIEDDATE = objEntr.MODIFIEDDATE;			
		}
        #endregion Constructor
        
        #region InitTable
		public static DataTable ToDataTable()
		{
			DataTable dt = new DataTable("BAOCAOTHUE");
			dt.Columns.AddRange(new DataColumn[] { 
				new DataColumn(Field.ID.ToString(), typeof(Int64)),
				new DataColumn(Field.NGAYPS.ToString(), typeof(DateTime)),
				new DataColumn(Field.KYHIEUHD.ToString(), typeof(String)),
				new DataColumn(Field.SOHD.ToString(), typeof(String)),
				new DataColumn(Field.TENKH.ToString(), typeof(String)),
				new DataColumn(Field.MSTHUE.ToString(), typeof(String)),
				new DataColumn(Field.HANGHOA.ToString(), typeof(String)),
				new DataColumn(Field.DOANHSO.ToString(), typeof(Double)),
				new DataColumn(Field.THUESUAT.ToString(), typeof(Int16)),
				new DataColumn(Field.THUEGTGT.ToString(), typeof(Double)),
				new DataColumn(Field.GHICHU.ToString(), typeof(String)),
				new DataColumn(Field.BANRA.ToString(), typeof(Boolean)),
				new DataColumn(Field.DIACHI.ToString(), typeof(String)),
				new DataColumn(Field.SOBT.ToString(), typeof(String)),
				new DataColumn(Field.EXP2HTKK.ToString(), typeof(Boolean)),
				new DataColumn(Field.NGAYGD.ToString(), typeof(DateTime)),
				new DataColumn(Field.CUSINFO.ToString(), typeof(String)),
                new DataColumn(Field.LOAIBT.ToString(), typeof(String)),
				new DataColumn(Field.CREATEBY.ToString(), typeof(String)),
				new DataColumn(Field.MODIFIEDBY.ToString(), typeof(String)),
				new DataColumn(Field.CREATEDATE.ToString(), typeof(DateTime)),
				new DataColumn(Field.MODIFIEDDATE.ToString(), typeof(DateTime))
			});
			return dt;
		}
		public DataRow ToDataRow(DataTable dt)
		{
			DataRow row = dt.NewRow();
			row[Field.ID.ToString()] = _ID;
			row[Field.NGAYPS.ToString()] = _NGAYPS;
			row[Field.KYHIEUHD.ToString()] = _KYHIEUHD;
			row[Field.SOHD.ToString()] = _SOHD;
			row[Field.TENKH.ToString()] = _TENKH;
			row[Field.MSTHUE.ToString()] = _MSTHUE;
			row[Field.HANGHOA.ToString()] = _HANGHOA;
			row[Field.DOANHSO.ToString()] = _DOANHSO;
			row[Field.THUESUAT.ToString()] = _THUESUAT;
			row[Field.THUEGTGT.ToString()] = _THUEGTGT;
			row[Field.GHICHU.ToString()] = _GHICHU;
			row[Field.BANRA.ToString()] = _BANRA;
			row[Field.DIACHI.ToString()] = _DIACHI;
			row[Field.SOBT.ToString()] = _SOBT;
			row[Field.EXP2HTKK.ToString()] = _EXP2HTKK;
			row[Field.NGAYGD.ToString()] = _NGAYGD;
			row[Field.CUSINFO.ToString()] = _CUSINFO;
            row[Field.LOAIBT.ToString()] = _LOAIBT;
			row[Field.CREATEBY.ToString()] = _CREATEBY;
			row[Field.MODIFIEDBY.ToString()] = _MODIFIEDBY;
			row[Field.CREATEDATE.ToString()] = _CREATEDATE;
			row[Field.MODIFIEDDATE.ToString()] = _MODIFIEDDATE;
			return row;
		}
        #endregion InitTable
    }
}
